/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utilitarios;

/**
 *
 * @author icaro
 */
public class Datas {

    public String getDiaSemana(String stDt) {

        String dt = "";
        try {
            java.text.DateFormat dtFormat = java.text.DateFormat.getDateInstance();
            java.util.Date dtFormated = dtFormat.parse(stDt);

            java.util.Calendar cal = new java.util.GregorianCalendar();
            cal.setTime(dtFormated);
            int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
            if (dayOfWeek == 1) {
                dt = "Domingo";
            }
            if (dayOfWeek == 2) {
                dt = "Segunda-Feira";
            }
            if (dayOfWeek == 3) {
                dt = "Terça-Feira";
            }
            if (dayOfWeek == 4) {
                dt = "Quarta-Feira";
            }
            if (dayOfWeek == 5) {
                dt = "Quinta-Feira";
            }
            if (dayOfWeek == 6) {
                dt = "Sexta-Feira";
            }
            if (dayOfWeek == 7) {
                dt = "Sábado";
            }
        } catch (Exception e) {
            System.out.println("Erro on getDia_formatado:" + e);
        }
        return dt;
    }
}
